
var config = {}

config.Publish = "android"; //wechatgame "android"

config.HeroMaxHp = 100;//英雄最大生命值

config.HeroHpLv = 1;//英雄生命等级

config.HeroHitLv = 1;//英雄攻击等级

config.CurHeroIndex = 1;//当前英雄编号

config.CurHeroWuDi = false;//当前英雄无敌

config.CurPetIndex = -1;//当前宠物编号 -1 (没有)

config.HeroState = 0; //0普通状态 1加速状态 2死亡状态

config.ScoreTime = 60; //记分时间间隔

config.BulletHpDrop = 100; //子弹攻击力

config.BossBulletHpDrop = 40000; //boss子弹攻击力

config.PetBulletHpDrop = 100; //宠物子弹攻击力

config.BossMaxHp = 80000; //boss血量

config.isToHero = false;//道具飞向英雄

config.isBossShow = false;//出现boss

config.BossBulletChangeCount = 0;//boss子弹变更计数

config.gotoUpLv = false;//去升级


//怪物属性
config.EnemyMaxHp = 100;
config.EnemyHit = 100;

config.AllRecordMi = 0;//总里程
config.MaxRecordMi = 0;//当前最高记录
config.PlayerGold = 0; //玩家金币

config.LaserNum = 0;//激光获取个数

config.doubleSpeed = false; //双倍速度游戏

config.userRank = 0; //用户排行

//道具编号
config.propIndexs = {
    gb_1 : 10,
    gb_10 : 11,
    gb_15 : 12,
    gb_20 : 13,
    gb_25 : 14,
    gb_30 : 15,
    gb_40 : 16,

    onrush : 20, //冲刺
    doubleBullet : 21, //双牌子弹
    magnet : 22, //磁铁
    laser : 23, //激光
    seawave : 24, //海浪
}

//金币道具
config.goldValue = [2,10,15,20,25,30,40];
//玩家金币
config.playerGold = 0;

//微信用户信息
config.UserData = {
    nickName:"",//昵称
    avatarUrl:"",//微信头像
    openid:"",//微信openid
    gender:1,//性别，1：男
    score:0,//最高得分
    subWidth:0,//子域的宽
    subHeight:0//子域的高
}

config.UpdateWxInfo = function(userInfo){
    config.UserData.nickName = userInfo.nickName;
    config.UserData.gender = userInfo.gender;
    config.UserData.avatarUrl = userInfo.avatarUrl;
}

//角色信息
config.heroInfo = {
    'hero1':{'hit':1,'hp':1,'locked':false,'monney':0},
    'hero2':{'hit':1,'hp':1,'locked':true,'monney':10000},
    'hero3':{'hit':1,'hp':1,'locked':true,'monney':15000},
    'hero4':{'hit':1,'hp':1,'locked':true,'monney':20000},
    'hero5':{'hit':1,'hp':1,'locked':true,'monney':60000},
}
//宠物信息
config.petInfo = {
    'pet1':{'lv':1,'hit':50,'exist':false,'isChuZhan':false,'name':"玳瑁"},
    'pet2':{'lv':1,'hit':100,'exist':false,'isChuZhan':false,'name':"泡泡"},
    'pet3':{'lv':1,'hit':150,'exist':false,'isChuZhan':false,'name':"天星"},
    'pet4':{'lv':1,'hit':200,'exist':false,'isChuZhan':false,'name':"神龟"},
    'pet5':{'lv':1,'hit':250,'exist':false,'isChuZhan':false,'name':"皇鲸"},
    'pet6':{'lv':1,'hit':300,'exist':false,'isChuZhan':false,'name':"龙王"},
}

//转盘对应宠物编号 7(500) 8(9000)
config.ZhuanPanPets=[0,1,8,2,5,6,4,3,7];


config.weiXinCode = "123445";

//获取随机数
config.getRandom = function(index){
    index = Math.round(Math.random() * index);
    return index;
}

//分享文字
config.shareTxt = {
    "1":["30秒已经是我的极限了"],
    "2":["没钱啦，快来帮帮我"],
    "3":["是兄弟一起冲"],
    "4":["一个人在家也很嗨"],
    "5":["一男子携带杀伤性武器冲进某所"],
}
//分享图片
config.shareImg = {
    "1":"share1.png",
    "2":"share2.png",
    "3":"share3.png",
    "4":"share4.png",
    "5":"share5.png",
}
config.getShareImgPath = function(name){
    // return cc.url.raw("resources/image/" + config.shareImg[name]);
    return config.imagePath() + config.shareImg[name];
}

config.imagePath = function () {
    return wx.env.USER_DATA_PATH + "/yxxqq_res/image/"; //用户目录图片路径
}
config.soundsPath = function () {
    return wx.env.USER_DATA_PATH + "/yxxqq_res/sounds/"; //用户目录音频路径
}

config.loadImage = function(imagnode,name,resPath){
    // var suffix = ".png";
    var path = cc.url.raw(resPath + name + ".png");
    if(typeof(wx)=="undefined"){
    }else{
        path = wx.env.USER_DATA_PATH + "/yxxqq_res/image/" + name + ".png";
    }
    cc.loader.load(path,function(err, texture){
        imagnode.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
    });
}

module.exports = config;

